<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [1, 5, 6, 3, 4, 9, 8, 3, 7]
        function lianJie(arr, str) {
            return arr.join(str)
            
        }

        var str = prompt("请输入想要用来间隔的符号", "|")
        console.log(lianJie(arr, str));
    </script>
</head>

<body>

</body>

</html>